<?php
/**
 * Created by PhpStorm.
 * User: dfh
 * Date: 2016/9/28
 * Time: 20:05
 */
header('content-type:text/html;charset=utf-8');
function getFileExt($path){
    $ext=substr($path, strrpos($path,'.')+1);
    return  $ext;}
    $path='C:\image\apple.jpg';
    $ext=getFileExt($path);
echo"<p>文件后缀：$path</p>";
echo"<p>文件前缀：$ext</p>";
?>
